Integrand size = 41, antiderivative size = 112 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=-\frac {2 (b B-a (A-C)) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 (3 A b+3 a B+b C) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 b C \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 (b B+a C) \sin (c+d x)}{d \sqrt {\cos (c+d x)}} \]
[Out]
Time = 0.42 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {4197, 3110, 3100, 2827, 2720, 2719} \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) (3 a B+3 A b+b C)}{3 d}-\frac {2 E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) (b B-a (A-C))}{d}+\frac {2 (a C+b B) \sin (c+d x)}{d \sqrt {\cos (c+d x)}}+\frac {2 b C \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)} \]
[In]
[Out]
Rule 2719
Rule 2720
Rule 2827
Rule 3100
Rule 3110
Rule 4197
Rubi steps \begin{align*} \text {integral}& = \int \frac {(b+a \cos (c+d x)) \left (C+B \cos (c+d x)+A \cos ^2(c+d x)\right )}{\cos ^{\frac {5}{2}}(c+d x)} \, dx \\ & = \frac {2 b C \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}-\frac {2}{3} \int \frac {-\frac {3}{2} (b B+a C)-\frac {1}{2} (3 A b+3 a B+b C) \cos (c+d x)-\frac {3}{2} a A \cos ^2(c+d x)}{\cos ^{\frac {3}{2}}(c+d x)} \, dx \\ & = \frac {2 b C \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 (b B+a C) \sin (c+d x)}{d \sqrt {\cos (c+d x)}}-\frac {4}{3} \int \frac {\frac {1}{4} (-3 A b-3 a B-b C)+\frac {3}{4} (b B-a (A-C)) \cos (c+d x)}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 b C \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 (b B+a C) \sin (c+d x)}{d \sqrt {\cos (c+d x)}}-(b B-a (A-C)) \int \sqrt {\cos (c+d x)} \, dx-\frac {1}{3} (-3 A b-3 a B-b C) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = -\frac {2 (b B-a (A-C)) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 (3 A b+3 a B+b C) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 b C \sin (c+d x)}{3 d \cos ^{\frac {3}{2}}(c+d x)}+\frac {2 (b B+a C) \sin (c+d x)}{d \sqrt {\cos (c+d x)}} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.
Time = 14.42 (sec) , antiderivative size = 1555, normalized size of antiderivative = 13.88 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\cos ^{\frac {7}{2}}(c+d x) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (-\frac {2 (a A-2 b B-2 a C+a A \cos (2 c)) \csc (c) \sec (c)}{d}+\frac {4 b C \sec (c) \sec ^2(c+d x) \sin (d x)}{3 d}+\frac {4 \sec (c) \sec (c+d x) (b C \sin (c)+3 b B \sin (d x)+3 a C \sin (d x))}{3 d}\right )}{(b+a \cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x))}-\frac {4 A b \cos ^3(c+d x) \csc (c) \, _2F_1\left (\frac {1}{4},\frac {1}{2};\frac {5}{4};\sin ^2(d x-\arctan (\cot (c)))\right ) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \sec (d x-\arctan (\cot (c))) \sqrt {1-\sin (d x-\arctan (\cot (c)))} \sqrt {-\sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\arctan (\cot (c)))} \sqrt {1+\sin (d x-\arctan (\cot (c)))}}{d (b+a \cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sqrt {1+\cot ^2(c)}}-\frac {4 a B \cos ^3(c+d x) \csc (c) \, _2F_1\left (\frac {1}{4},\frac {1}{2};\frac {5}{4};\sin ^2(d x-\arctan (\cot (c)))\right ) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \sec (d x-\arctan (\cot (c))) \sqrt {1-\sin (d x-\arctan (\cot (c)))} \sqrt {-\sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\arctan (\cot (c)))} \sqrt {1+\sin (d x-\arctan (\cot (c)))}}{d (b+a \cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sqrt {1+\cot ^2(c)}}-\frac {4 b C \cos ^3(c+d x) \csc (c) \, _2F_1\left (\frac {1}{4},\frac {1}{2};\frac {5}{4};\sin ^2(d x-\arctan (\cot (c)))\right ) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \sec (d x-\arctan (\cot (c))) \sqrt {1-\sin (d x-\arctan (\cot (c)))} \sqrt {-\sqrt {1+\cot ^2(c)} \sin (c) \sin (d x-\arctan (\cot (c)))} \sqrt {1+\sin (d x-\arctan (\cot (c)))}}{3 d (b+a \cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sqrt {1+\cot ^2(c)}}-\frac {2 a A \cos ^3(c+d x) \csc (c) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (\frac {\, _2F_1\left (-\frac {1}{2},-\frac {1}{4};\frac {3}{4};\cos ^2(d x+\arctan (\tan (c)))\right ) \sin (d x+\arctan (\tan (c))) \tan (c)}{\sqrt {1-\cos (d x+\arctan (\tan (c)))} \sqrt {1+\cos (d x+\arctan (\tan (c)))} \sqrt {\cos (c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}} \sqrt {1+\tan ^2(c)}}-\frac {\frac {\sin (d x+\arctan (\tan (c))) \tan (c)}{\sqrt {1+\tan ^2(c)}}+\frac {2 \cos ^2(c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}}{\cos ^2(c)+\sin ^2(c)}}{\sqrt {\cos (c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}}}\right )}{d (b+a \cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x))}+\frac {2 b B \cos ^3(c+d x) \csc (c) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (\frac {\, _2F_1\left (-\frac {1}{2},-\frac {1}{4};\frac {3}{4};\cos ^2(d x+\arctan (\tan (c)))\right ) \sin (d x+\arctan (\tan (c))) \tan (c)}{\sqrt {1-\cos (d x+\arctan (\tan (c)))} \sqrt {1+\cos (d x+\arctan (\tan (c)))} \sqrt {\cos (c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}} \sqrt {1+\tan ^2(c)}}-\frac {\frac {\sin (d x+\arctan (\tan (c))) \tan (c)}{\sqrt {1+\tan ^2(c)}}+\frac {2 \cos ^2(c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}}{\cos ^2(c)+\sin ^2(c)}}{\sqrt {\cos (c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}}}\right )}{d (b+a \cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x))}+\frac {2 a C \cos ^3(c+d x) \csc (c) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (\frac {\, _2F_1\left (-\frac {1}{2},-\frac {1}{4};\frac {3}{4};\cos ^2(d x+\arctan (\tan (c)))\right ) \sin (d x+\arctan (\tan (c))) \tan (c)}{\sqrt {1-\cos (d x+\arctan (\tan (c)))} \sqrt {1+\cos (d x+\arctan (\tan (c)))} \sqrt {\cos (c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}} \sqrt {1+\tan ^2(c)}}-\frac {\frac {\sin (d x+\arctan (\tan (c))) \tan (c)}{\sqrt {1+\tan ^2(c)}}+\frac {2 \cos ^2(c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}}{\cos ^2(c)+\sin ^2(c)}}{\sqrt {\cos (c) \cos (d x+\arctan (\tan (c))) \sqrt {1+\tan ^2(c)}}}\right )}{d (b+a \cos (c+d x)) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x))} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(638\) vs. \(2(156)=312\).
Time = 3.26 (sec) , antiderivative size = 639, normalized size of antiderivative = 5.71
method | result | size |
default | \(-\frac {\sqrt {-\left (-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \left (\frac {2 A b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}+\frac {2 B a \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}-\frac {2 a A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}+\frac {2 a A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \left (\operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-\operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}+2 C b \left (-\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}{6 \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-\frac {1}{2}\right )^{2}}+\frac {\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{3 \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}\right )+\frac {2 \left (B b +C a \right ) \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \left (2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}\) | \(639\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.13 (sec) , antiderivative size = 229, normalized size of antiderivative = 2.04 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\sqrt {2} {\left (-3 i \, B a - i \, {\left (3 \, A + C\right )} b\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + \sqrt {2} {\left (3 i \, B a + i \, {\left (3 \, A + C\right )} b\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 3 \, \sqrt {2} {\left (-i \, {\left (A - C\right )} a + i \, B b\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 3 \, \sqrt {2} {\left (i \, {\left (A - C\right )} a - i \, B b\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) + 2 \, {\left (C b + 3 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{2}} \]
[In]
[Out]
\[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right ) \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \sqrt {\cos {\left (c + d x \right )}}\, dx \]
[In]
[Out]
\[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )} \sqrt {\cos \left (d x + c\right )} \,d x } \]
[In]
[Out]
\[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (b \sec \left (d x + c\right ) + a\right )} \sqrt {\cos \left (d x + c\right )} \,d x } \]
[In]
[Out]
Time = 19.56 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.64 \[ \int \sqrt {\cos (c+d x)} (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2\,A\,a\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,A\,b\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,a\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,B\,b\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{d\,\sqrt {\cos \left (c+d\,x\right )}\,\sqrt {{\sin \left (c+d\,x\right )}^2}}+\frac {2\,C\,a\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{d\,\sqrt {\cos \left (c+d\,x\right )}\,\sqrt {{\sin \left (c+d\,x\right )}^2}}+\frac {2\,C\,b\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {3}{4},\frac {1}{2};\ \frac {1}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{3\,d\,{\cos \left (c+d\,x\right )}^{3/2}\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \]
[In]
[Out]